package org.tinygroup.channel.test.protocol.user;

import org.tinygroup.channel.protocol.ProtocolTrans;
import org.tinygroup.channel.test.protocol.pojo.User;
import org.tinygroup.context.Context;

public class UserTrans implements ProtocolTrans<String, User, String, User> {

	public User transReqFromMessage(String reqMessage, Context context) {
		
		return User.parse(reqMessage);
	}

	public String transRespToMessage(User resp, Context context) {
		return resp.toString();
	}

	
	public String transReqToMessage(User req, Context context) {
		return req.toString();
	}

	
	public User transRespFromMessage(String respMessage, Context context) {
		return User.parse(respMessage);
	}


}
